package com.dtec.resource.settingInfo;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;

public class History {
	
	private String id="";
	private String dialDate = "";
	/**
	 * dialType呼入呼出:in or out
	 */
	private String dialType = "";
	private String contactAddress = "";

	public String getDialDate() {
		if (dialDate == null || "".equals(dialDate)) {
			setDialDate(null);
		}
		return dialDate;
	}

	public void setDialDate(String dialDate) {
		if (dialDate == null || "".equals(dialDate)) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
			Date date = Calendar.getInstance().getTime();
			this.dialDate = sdf.format(date);
		} else {
			this.dialDate = dialDate;
		}
	}

	public String getDialType() {
		return dialType;
	}

	public void setDialType(String dialType) {
		this.dialType = dialType;
	}

	public String getContactAddress() {
		return contactAddress;
	}

	public void setContactAddress(String contactAddress) {
		this.contactAddress = contactAddress;
	}
	
	public String getId() {
		if (id == null || "".equals(id)) {
			setId(null);
		}
		return id;
	}

	public void setId(String id) {
		if (id == null || "".equals(id)) {
			this.id = UUID.randomUUID().toString();
		} else {
			this.id = id;
		}
	}

}
